package com.generalbackend.role.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;
import java.util.List;

/**
* ClassName: Permission
* @Description 菜单权限表实体类
* @author tim.xie
* @date 2021-12-10 11:01
*/

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_permission")
public class Permission  {
	/**
	 * 
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	@TableId(value = "id", type = IdType.ID_WORKER)
    private String id;
	/**
	 * 菜单名称
	 */
    @TableField("name")
    private String name;
	/**
	 * 上一级菜单id
	 */
    @TableField("parent_id")
    private String parentId;
	/**
	 * 菜单路由
	 */
    @TableField("url")
    private String url;
	/**
	 * 排序从小到大
	 */
    @TableField("sort")
    private Integer sort;
	/**
	 * 类型1,2,3菜单层级，4按钮
	 */
    @TableField("type")
    private Integer type;
	/**
	 * icon图标
	 */
    @TableField("icon")
    private String icon;
	/**
	 * 模块
	 */
    @TableField("module")
    private Integer module;
	/**
	 * 授权(1授权，0未授权)
	 */
    @TableField("authorization")
    private Integer authorization;
	/**
	 * 描述
	 */
    @TableField("description")
    private String description;
	/**
	 * 创建时间
	 */
    @TableField("create_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
	/**
	 * 更新时间
	 */
    @TableField("gmt_modified")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date gmtModified;

	/**
	 * 子菜单
	 */
	@TableField(exist = false)
	private List<Permission> submenu;


}